import request from "@/router/axios";

//详情
export const getDetail = (id) => {
  return request({
    url: "/api/hg-quality/monthlyplan/detail",
    method: "get",
    params: { id }
  });
};
//根据计划时间获取年度计划编号
export const getYearPlan = (year) => {
  return request({
    url: "/api/hg-quality/monthlyplan/getYearPlan",
    method: "get",
    params: { year }
  });
};
//根据id获取计划评审内容
export const getPlanReview = (id) => {
  return request({
    url: "/api/hg-quality/monthlyplan/getPlanReview",
    method: "get",
    params: { id }
  });
};
//列表
export const getList = (current, size, params) => {
  return request({
    url: "/api/hg-quality/monthlyplan/list",
    method: "get",
    params: {
      current,
      size,
      ...params
    }
  });
};
//无分页列表
export const getListNoPage = () => {
  return request({
    url: "/api/hg-quality/monthlyplan/monthlyPlanList",
    method: "get",
    params: { }
  });
};
//删除
export const remove = ids => {
  return request({
    url: "/api/hg-quality/monthlyplan/remove",
    method: "post",
    params: { ids }
  });
};
//子表评审内容删除
export const removePlanReview = id => {
  return request({
    url: "/api/hg-quality/monthlyplan/removePlanReview",
    method: "post",
    params: { id }
  });
};
//子表资料删除
export const planprofileRemove = id => {
  return request({
    url: "/api/hg-quality/monthlyplan/removePlanProfile",
    method: "post",
    params: { id }
  });
};
//保存、修改
export const save = data => {
  return request({
    url: "/api/hg-quality/monthlyplan/save",
    method: "post",
    data
  });
};
//新增月度计划资料
export const saveProfile = data => {
  return request({
    url: "/api/hg-quality/monthlyplan/saveProfile",
    method: "post",
    data
  });
};
//编辑月度计划资料
export const updateProfile = data => {
  return request({
    url: "/api/hg-quality/monthlyplan/updateProfile",
    method: "post",
    data
  });
};
//获取审核员信息
export const getAuditUser = (name) => {
  return request({
    url: "/api/hg-quality/monthlyplan/getAuditUser",
    method: "get",
    params: { ...name }
  });
};
//启动流程--提交
export const startProcess = id => {
  return request({
    url: "/api/hg-quality/monthlyplan/start-process",
    method: "post",
    params: { id }
  });
};
//提交资料附件
export const submitProfileAttach = id => {
  return request({
    url: "/api/hg-quality/monthlyplan/submitProfileAttach",
    method: "post",
    params: { id }
  });
};
//保存资料附件信息
export const saveProfileAttach = data => {
  return request({
    url: "/api/hg-quality/monthlyplan/saveProfileAttach",
    method: "post",
    data
  });
};
